import hide_loading from '@dfeidao/atom-wxapp/api/interaction/hide-loading';
import show_loading from '@dfeidao/atom-wxapp/api/interaction/show-loading';
import { IFeidaoAiWeappPage } from '@dfeidao/atom-wxapp/interfaces';
import set_local from '@dfeidao/atom-wxapp/local/set';
import nodejs from '@dfeidao/atom-wxapp/msg/nodejs';
import render from '@dfeidao/atom-wxapp/render/render';

export default async function a001(fd: IFeidaoAiWeappPage) {
	try {
		// app-pick_list-find-1
		const data = await nodejs('ready-list/s001', {
			filter: {
				product_up_status: "已上架"
			},
			desc: ['pick_time'],
			page_size: 2,
			page_no: 1
		});
		console.log(data, '-----------初始化数据--------------');
		render(fd, {
			data
		});
		set_local(fd, 'page_no', 1);
		set_local(fd, 'name', '');
		set_local(fd, 'list_data', data);
	} catch (error) {
		show_loading('读取数据失败');
		hide_loading();
	}
}
